Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added compatibility project for Entity Framework Version 6 #307

Merged
merged 1 commit into from
Oct 24, 2024
Merged

Added compatibility project for Entity Framework Version 6 #307

merged 1 commit into from
Oct 24, 2024

Conversation

danm-de
Copy link

@danm-de danm-de commented Oct 23, 2024

Hello,

I work for a healthcare company. The wheels of change turn somewaht slower here, which is why we still have various projects with EF6 (which cannot easily be converted to EF Core because it does not support .NET 4.8.1).

This pull request contains a compatibility package for Entity Framework Version 6. It seems to me that it is still very widespread and actively used. The most recently version 6.5.1 (released on 2024-06-17) has already been downloaded ~1.5 million times.

I checked the resulting SQL queries of the following LINQ query and got the expected statement (correctly implemented in SQL):

var page10 = await db.Persons
    .OrderBy(x => x.Id)
    .ToPagedListAsync(pageNumber: 10, pageSize: 25);

The SQL command(s) sent to the MS SQL server:

--- total item count
SELECT 
    [GroupBy1].[A1] AS [C1]
    FROM ( SELECT 
        COUNT(1) AS [A1]
        FROM [dbo].[Persons] AS [Extent1]
    )  AS [GroupBy1]

--- get page 10
SELECT 
    [Extent1].[Id] AS [Id], 
    [Extent1].[Firstname] AS [Firstname], 
    [Extent1].[Lastname] AS [Lastname]
    FROM [dbo].[Persons] AS [Extent1]
    ORDER BY row_number() OVER (ORDER BY [Extent1].[Id] ASC)
    OFFSET 225 ROWS FETCH NEXT 25 ROWS ONLY 

Added compatibility package for Entity Framework version 6.
@danm-de
Copy link
Author

danm-de commented Oct 23, 2024

Ah just looked through the issues. In fact, it seems we're not the only ones.

Reference #306

@a-gubskiy a-gubskiy changed the base branch from master to dev October 24, 2024 10:11
@a-gubskiy a-gubskiy merged commit bfb8d4d into dncuug:dev Oct 24, 2024
1 check passed
@a-gubskiy
Copy link
Member

@danm-de the beta version of package will be available here soon: https://www.nuget.org/packages/X.PagedList.EF6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants